package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.EmployeeDTO;
import com.sky.dto.EmployeePageQueryDTO;
import com.sky.entity.Employee;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    Employee getByUsername(@Param("username") String username);

    @AutoFill(OperationType.INSERT)
    void insert(Employee employee);

    Page<Employee> findByName(EmployeePageQueryDTO employeePageQueryDTO);

//    @AutoFill(OperationType.UPDATE)
    void updateStatus(Integer status, Integer id);

    Employee getById(Integer id);

    @AutoFill(OperationType.UPDATE)
    void updateEmp(Employee employee);
}
